CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(Profiler C CXX)

SET(CC_COVERAGE_COMPILE_FLAGS "-fPIC")
SET(CC_COVERAGE_LINK_FLAGS    "")

SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${CC_COVERAGE_COMPILE_FLAGS} ${CC_COVERAGE_LINK_FLAGS}" )
SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} ${CC_COVERAGE_LINK_FLAGS}" ) 

file(GLOB common_sources ./*.cpp)

find_package(Threads REQUIRED)
find_package(Curses REQUIRED)	

set(CORELIBS ${THREAD_LIBRARY} ${CURSES_LIBRARY})

add_library(profiler SHARED ${common_sources})

target_link_libraries( profiler ${CMAKE_THREAD_LIBS_INIT} ${CORELIBS} )
